﻿// cpptest.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include <chrono> 
#include "fillCircle.h"



void testFillCircle()
{
    int wid = 200;
    size_t size = wid * wid;
    uint8_t* data = (uint8_t*)calloc(1, size);
    auto start = std::chrono::high_resolution_clock::now();

    fillCicle<uint8_t>(data, wid, 0);
    auto end = std::chrono::high_resolution_clock::now();

    // 计算执行时间  
    std::chrono::duration<double> diff = end - start;
    std::cout << "use time: " << diff.count() * 1000.0 << " ms\n";

    FILE* fp = fopen("p:/temp/ll1.log", "wt");
    if (fp != nullptr) {
        for (size_t c = 0; c < wid; c++) {
            uint8_t* pData = data + c * wid;
            for (size_t x = 0; x < wid; x++) {
                fprintf(fp, "%u ", pData[x]);
            }
            fprintf(fp, "\n");
        }

        fclose(fp);
    }
    free(data);
}




int main()
{
    testFillCircle();
}


